home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 001 / pckermit.arc / PCKERM.COR < prev    next >
Encoding:
Text File  |  1980-01-01  |  16.8 KB  |  800 lines

  1. -!PCKERM.ASM_PCKERM.ASM
  2. -1,1
  3. ;    .XLIST
  4. -23,89
  5. IBMPC   EQU     0               ; For IBM PC conditional assembly.
  6. Z100    EQU    1        ; For Heath/Zenith Z-100
  7. STEVE   EQU     0               ; For Steve's homebrew assembly.
  8.  
  9. ; System dependent parameters
  10.  
  11. IF IBMPC
  12.  
  13. DEFESC  EQU     ']'-100Q        ; The default escape character.
  14.  
  15. MDMDAT    EQU    03F8H        ; Address of modem port (data)
  16. MDMSTS    EQU    03FDH        ; Address of modem port status
  17. MDMCOM    EQU    03FBH        ; Address of modem port command
  18.  
  19. MDMINP    EQU    1        ; Input ready bit
  20.  
  21. MDMINTV    EQU    0030H        ; Address of modem port interrupt vector
  22. MDMINTO    EQU    0EFH        ; Mask to enable interrupt for modem port
  23. MDMINTC    EQU    010H        ; Bit to set to disable interrupts for modem
  24. INTCONT    EQU    0021H        ; Address of 8259 interrupt controller ICW2-3
  25. INTCON1    EQU    0020H        ; Address of 8259 ICW1
  26. EOICOM    EQU    0064H        ; End of interrupt
  27. -97
  28. ; Interrupt types for extra system functions
  29.  
  30. BIOS    EQU     10H
  31. COMM    EQU    14H
  32. KEYB    EQU    16H
  33. ENDIF
  34.  
  35. IF Z100
  36.  
  37. DEFESC  EQU     '\'-100Q        ; The default escape character.
  38.  
  39. ; BIOS entry points
  40.  
  41. BIOS_SEG SEGMENT AT 40H        ; Define segment where BIOS really is
  42.  
  43.     ORG    6*3
  44. BIOS_AUXOUT LABEL FAR        ; AUX output routine
  45.  
  46.     ORG    26*3
  47. BIOS_AUXFUNC LABEL FAR        ; AUX: function
  48.  
  49. BIOS_SEG ENDS            ; End of BIOS segment defs
  50.  
  51. ; Function codes for BIOS_AUXFUNC
  52.  
  53. CHR_READ    EQU    1    ; Read character
  54. CHR_STATUS    EQU    2    ; Get status
  55.   CHR_SFGS    EQU    0    ; Get status subfunction
  56.   CHR_SFGC    EQU    1    ; Get config subfunction
  57. CHR_CONTROL    EQU    3    ; Control function
  58.  CHR_CFSU    EQU    0    ; Set new configuration parameters
  59.  
  60.  
  61. B00455    EQU    0        ; 45.5 baud
  62. B0050    EQU    1        ; 50 baud
  63. B0075    EQU    2        ; 75 baud
  64. B0110    EQU    3        ; 110 baud
  65. B01345    EQU    4        ; 134.5 baud
  66. B0150    EQU    5        ; 150 baud
  67. B0300    EQU    6        ; 300 baud
  68. B0600    EQU    7        ; 600 baud
  69. B1200    EQU    8        ; 1200 baud
  70. B1800    EQU    9        ; 1800 baud
  71. B2000    EQU    10        ; 2000 baud
  72. B2400    EQU    11        ; 2400 baud
  73. B4800    EQU    12        ; 4800 baud
  74. B9600    EQU    13        ; 9600 baud
  75. B19200    EQU    14        ; 19200 baud
  76. B38400    EQU    15        ; 38400 baud
  77. ENDIF
  78.  
  79. BELL    EQU     07Q
  80. TAB     EQU     11Q
  81. LF      EQU     12Q
  82. FF      EQU     14Q
  83. CR      EQU     15Q
  84. XON     EQU     21Q
  85. XOFF    EQU     23Q
  86. ESC     EQU     33Q
  87. DEL     EQU     177Q
  88. BS    EQU    08H
  89.  
  90. DOS     EQU     21H
  91.  
  92. CONIN   EQU     01H
  93. CONOUT  EQU     02H
  94. RDRIN   EQU     03H
  95. PUNOUT  EQU     04H
  96. LSTOUT  EQU     05H
  97. DCONIO  EQU     06H
  98. GTIOB   EQU     07H
  99. PRSTR   EQU     09H
  100. CONSTAT EQU     0BH
  101. OPENF   EQU     0FH
  102. CLOSF   EQU     10H
  103. SFIRST  EQU     11H
  104. SNEXT   EQU     12H
  105. DELF    EQU     13H
  106. READF   EQU     14H             ; Read from the file.
  107. WRITEF  EQU     15H
  108. MAKEF   EQU     16H
  109. SETDMA    EQU    1AH        ; Set disk transfer address
  110. CFLSZ   EQU     23H
  111.  
  112. MAXPKT  EQU     '~'-' '+2Q      ; Maximum size of a packet.
  113. MAXTRY  EQU     05Q             ; Default number of retries on a packet.
  114. IMXTRY  EQU     20Q             ; Default number of retries send initiate.
  115. DRPSIZ  EQU     5EH             ; Default receive packet size.
  116. DSPSIZ  EQU     20H             ; Default send packet size.
  117. DSTIME  EQU     08H             ; Default send time out interval.
  118. DRTIME  EQU     05H             ; Default receive time out interval.
  119. DSPAD   EQU     00H             ; Default send padding.
  120. DRPAD   EQU     00H             ; Default receive padding.
  121. DSPADC  EQU     00H             ; Default send padding char.
  122. DRPADC  EQU     00H             ; Default receive padding char.
  123. DSEOL   EQU     CR              ; Default send EOL char.
  124. DREOL   EQU     CR              ; Default receive EOL char.
  125. DSQUOT  EQU     '#'             ; Default send quote char.
  126. DRQUOT  EQU     '#'             ; Default receive quote char.
  127.  
  128. SOH     EQU     01H             ; Start of header char.
  129.  
  130. BUFSIZ  EQU     80H             ; Size of DMA.
  131. MAXFIL  EQU     50H             ; Maximum number of files allowed.
  132.  
  133. DIASW   EQU     01H             ; Default is diagnostics on.
  134.  
  135. CMKEY   EQU     01H             ; Parse a keyword.
  136. CMIFI   EQU     02H             ; Parse an input file spec (can be wild).
  137. CMOFI   EQU     03H             ; Parse an output file spec.
  138. CMCFM   EQU     04H             ; Parse a confirm.
  139.  
  140. -107,107
  141. versio  db      'CUCCA'
  142. IF IBMPC
  143.     db    ' IBM-PC'
  144. ENDIF
  145. IF Z100
  146.     db    '/Stevens Heath/Zenith Z-100'
  147. ENDIF
  148.     db    ' Kermit-86 - ver 1.0',cr,lf,
  149. -117,117
  150.     db    'type Ctrl-'
  151. IF IBMPC
  152.     db    ']'
  153. ENDIF
  154. IF Z100
  155.     db    '\'
  156. ENDIF
  157.     db    '-C to return to PC]',cr,lf,'$'
  158. -118:tmsg2    db    cr,lf,'[Back at micro]',cr,lf,'$'
  159. -164,164
  160. IF IBMPC
  161.         db      cr,lf,'VT52-EMULATION$'
  162. ENDIF
  163. IF Z100
  164.     db    '$'
  165. ENDIF
  166. -169,169
  167. IF IBMPC
  168. bdhlp    db    cr,lf,'300   1200   1800   4800$'
  169. ENDIF
  170. IF Z100
  171. bdhlp    db    cr,lf,'45.5    50    75    110    134.5    150    300'
  172.     db    '    600    1200    1800'
  173.     db    cr,lf,'    2000    2400    4800    9600    19200    38400'
  174. ENDIF
  175. -177,184
  176. IF IBMPC
  177. vtemst  db      cr,lf,'VT52 emulation on$'
  178. novtst  db      cr,lf,'VT52 emulation off$'
  179. ENDIF
  180. ibmst   db      cr,lf,'IBM on$'
  181. noibm   db      cr,lf,'IBM off$'
  182. IF Z100
  183. b04st    db    cr,lf,'Baud rate is 45.5$'
  184. b05st    db    cr,lf,'Baud rate is 50$'
  185. b07st    db    cr,lf,'Baud rate is 75$'
  186. b11st    db    cr,lf,'Baud rate is 110$'
  187. b13st    db    cr,lf,'Baud rate is 134.5$'
  188. b15st    db    cr,lf,'Baud rate is 150$'
  189. ENDIF
  190. b03st    db    cr,lf,'Baud rate is 300$'
  191. IF Z100
  192. b06st    db    cr,lf,'Baud rate is 600$'
  193. ENDIF
  194. b12st    db    cr,lf,'Baud rate is 1200$'
  195. b18st    db    cr,lf,'Baud rate is 1800$'
  196. IF Z100
  197. b20st    db    cr,lf,'Baud rate is 2000$'
  198. b24st    db    cr,lf,'Baud rate is 2400$'
  199. ENDIF
  200. b48st    db    cr,lf,'Baud rate is 4800$'
  201. IF Z100
  202. b96st    db    cr,lf,'Baud rate is 9600$'
  203. b19st    db    cr,lf,'Baud rate is 19200$'
  204. b38st    db    cr,lf,'Baud rate is 38400$'
  205. ENDIF
  206. -191,191
  207. outlin  db      cr,lf,'     CUCCA'
  208. IF IBMPC
  209.     db    ' IBM-PC'
  210. ENDIF
  211. IF Z100
  212.     db    '/Stevens Heath/Zenith Z-100'
  213. ENDIF
  214.     db    ' Kermit-86 V1.0',
  215. -199,200
  216. IF IBMPC
  217. clrlin  db      cr,'$'            ; Clear line (just the cr part).
  218. ENDIF
  219. IF Z100
  220. clrlin    db    cr,esc,'K$'        ; Clear line on Z-100
  221. clrscr    db    esc,'H',esc,'J$'    ; Home and clear screen
  222. homcur    db    esc,'H$'        ; Home cursor
  223. ENDIF
  224. prsp    db    ' $'            ; Print a space.
  225.  
  226. ; Cursor addressing items
  227.  
  228. IF IBMPC
  229. -201:scrhi    dw    0434H            ; Err when 8th bit is on.
  230. -224
  231. ENDIF
  232.  
  233. IF Z100
  234. scrhi    db    esc,'Y',23H,54H,lf,'$'    ; 8th bit on in character
  235. scrrpr    db    esc,'Y',27H,20H,'$'    ; Prompt when Kermit ends
  236. screrr    db    esc,'Y',26H,20H,'$'    ; Error messages
  237. scrfln    db    esc,'Y',25H,2CH,'$'    ; File name
  238. scrnrt    db    esc,'Y',23H,35H,lf,'$'    ; Number of retries
  239. scrnp    db    esc,'Y',23H,35H,'$'    ; Number of packets
  240. scrfr    db    esc,'Y',26H,20H,'$'    ; Rename file
  241. scrst    db    esc,'Y',23H,54H,'$'    ; Status
  242. scrsp    db    esc,'Y',28H,20H,'$'    ; send packet
  243. scrrp    db    esc,'Y',2AH,20H,'$'    ; Receive packet
  244. ENDIF
  245. -245,245
  246. IF IBMPC
  247. settab  db      07H             ; seven entries.
  248. ENDIF
  249. IF Z100
  250. settab    db    06H        ; Only six entries for Z-100
  251. ENDIF
  252. -258,259
  253. IF IBMPC
  254.         db      0EH,'VT52-EMULATION$'
  255.         dw      vt52em
  256. ENDIF
  257. -272
  258. IF IBMPC
  259. -281
  260. ENDIF
  261. IF Z100
  262. bdtab    db    010H        ; 16 entries
  263.     db    03H,'110$'
  264.     dw    b0110
  265.     db    04H,'1200$'
  266.     dw    b1200
  267.     db    03H,'134$'
  268.     dw    b01345
  269.     db    03H,'150$'
  270.     dw    b0150
  271.     db    04H,'1800$'
  272.     dw    b1800
  273.     db    05H,'19200$'
  274.     dw    b19200
  275.     db    04H,'2000$'
  276.     dw    b2000
  277.     db    04H,'2400$'
  278.     dw    b2400
  279.     db    03H,'300$'
  280.     dw    b0300
  281.     db    05H,'38400$'
  282.     db    b38400
  283.     db    02H,'45$'
  284.     dw    b00455
  285.     db    04H,'4800$'
  286.     dw    b4800
  287.     db    02H,'50$'
  288.     dw    b0050
  289.     db    03H,'600$'
  290.     dw    b0600
  291.     db    02H,'75$'
  292.     dw    b0075
  293.     db    04H,'9600$'
  294.     dw    b9600
  295. ENDIF
  296. -282: 
  297. -324,324
  298. IF IBMPC
  299. vtflg   db      1               ; VT52 emulation flag (default on).
  300. ENDIF
  301. -339,339
  302. IF IBMPC
  303. baud    db    B4800        ; Use default of 4800.
  304. ENDIF
  305. IF Z100
  306. auxcnf    db    4 dup(?)    ; AUX port configuration info
  307. baud    db    ?        ; Baud rate
  308. auxcnf1    db    12 dup(?)    ; Rest of configuration info
  309. ENDIF
  310. -388,390
  311. -404
  312.         call cmblnk             ; Clear the screen.
  313.     call locate
  314.  
  315. -409,409
  316.     mov ah,setdma        ; Set disk transfer address.
  317. -410:    mov dx,offset buff
  318. -413,413
  319. IF IBMPC
  320.     mov dx,mdmcom        ; LCR -- Initialize baud rate.
  321. -418,418
  322.     mov dx,mdmdat
  323. -424,426
  324.     mov dx,mdmcom
  325.     mov al,bl
  326.     out dx,al
  327. ENDIF
  328.  
  329. IF Z100
  330.     mov bx,ds        ; Set up pointer to config info
  331.     mov es,bx        ;  .  .  .
  332.     mov bx,offset auxcnf    ;  .  .  .
  333.     mov ah,chr_status    ; Get the function code
  334.     mov al,chr_sfgc        ; And the subfunction to get config
  335.     call bios_auxfunc    ; Get the block
  336. ENDIF
  337. -486
  338. IF IBMPC
  339. -491
  340. ENDIF
  341.  
  342. IF Z100
  343.     mov dx,offset screrr    ; Get address of string to position cursor
  344.     mov ah,prstr        ; Get the function code
  345.     int dos            ; Print the addressing string
  346.     ret            ; And return
  347. ENDIF
  348. -492:ERPOS    ENDP
  349. -496
  350. IF IBMPC
  351. -501
  352. ENDIF
  353.  
  354. IF Z100
  355.     mov ah,prstr        ; Get the function to print string
  356.     mov dx,offset scrnrt    ; Get the address of the string
  357.     int dos            ; Print the string
  358.     ret            ; And return
  359. ENDIF
  360. -507
  361. IF IBMPC
  362. -511
  363. ENDIF
  364.  
  365. IF Z100
  366.     mov ah,prstr        ; Get the function to print string
  367.     mov dx,offset scrhi    ; Get the address of the string
  368.     int dos            ; Print the string
  369. ENDIF
  370. -618,618
  371. read2:
  372. IF IBMPC
  373.     mov ah,2        ; Position cursor.
  374. -619:    mov dx,scrst
  375. -621
  376. ENDIF
  377. IF Z100
  378.     mov ah,prstr        ; Get print string function
  379.     mov dx,offset scrst    ; and string to move cursor
  380.     int dos            ; Print the string
  381. ENDIF
  382. -624
  383. IF IBMPC
  384. -628
  385. ENDIF
  386. IF Z100
  387.     mov ah,prstr        ; Get print string function
  388.     mov dx,offset scrnp    ; and string to move cursor
  389.     int dos            ; Print the string
  390. ENDIF
  391. -645
  392. IF IBMPC
  393. -649
  394. ENDIF
  395. IF Z100
  396.     mov ah,prstr        ; Get print string function
  397.     mov dx,offset scrst    ; and string to move cursor
  398.     int dos            ; Print the string
  399. ENDIF
  400. -650:        mov dx,offset infms3    ; Plus a little cuteness.
  401. -652
  402. IF IBMPC
  403. -657,658
  404. ENDIF
  405. IF Z100
  406.     mov ah,prstr        ; Get print string function
  407.     mov dx,offset scrrpr    ; and string to move cursor
  408.     int dos            ; Print the string
  409. ENDIF
  410.         jmp rskp
  411. read6:
  412. IF IBMPC
  413.     mov ah,2        ; Position cursor.
  414. -661
  415. ENDIF
  416. IF Z100
  417.     mov ah,prstr        ; Get print string function
  418.     mov dx,offset scrst    ; and string to move cursor
  419.     int dos            ; Print the string
  420. ENDIF
  421. -664
  422. IF IBMPC
  423. -668
  424. ENDIF
  425. IF Z100
  426.     mov ah,prstr        ; Get print string function
  427.     mov dx,offset scrrpr    ; and string to move cursor
  428.     int dos            ; Print the string
  429. ENDIF
  430. -669:        jmp rskp
  431. -1008,1008
  432. send2:
  433. IF IBMPC
  434.     mov ah,2                ; Position cursor.
  435. -1011
  436. ENDIF
  437. IF Z100
  438.     mov ah,prstr        ; Get print string function
  439.     mov dx,offset scrst    ; and string to move cursor
  440.     int dos            ; Print the string
  441. ENDIF
  442. -1014
  443. IF IBMPC
  444. -1018
  445. ENDIF
  446. IF Z100
  447.     mov ah,prstr        ; Get print string function
  448.     mov dx,offset scrnp    ; and string to move cursor
  449.     int dos            ; Print the string
  450. ENDIF
  451. -1042
  452. IF IBMPC
  453. -1043:    mov ah,2                ; Position cursor.
  454. -1046
  455. ENDIF
  456. IF Z100
  457.     mov ah,prstr        ; Get print string function
  458.     mov dx,offset scrst    ; and string to move cursor
  459.     int dos            ; Print the string
  460. ENDIF
  461. -1049
  462. IF IBMPC
  463. -1054,1055
  464. ENDIF
  465. IF Z100
  466.     mov ah,prstr        ; Get print string function
  467.     mov dx,offset scrrpr    ; and string to move cursor
  468.     int dos            ; Print the string
  469. ENDIF
  470.         jmp rskp
  471. send8:
  472. IF IBMPC
  473.     mov ah,2                ; Position cursor.
  474. -1058
  475. ENDIF
  476. IF Z100
  477.     mov ah,prstr        ; Get print string function
  478.     mov dx,offset scrst    ; and string to move cursor
  479.     int dos            ; Print the string
  480. ENDIF
  481. -1061
  482. IF IBMPC
  483. -1062:    mov ah,2
  484. -1065
  485. ENDIF
  486. IF Z100
  487.     mov ah,prstr        ; Get print string function
  488.     mov dx,offset scrrpr    ; and string to move cursor
  489.     int dos            ; Print the string
  490. ENDIF
  491. -1180
  492. IF IBMPC
  493. -1184
  494. ENDIF
  495. IF Z100
  496.     mov ah,prstr        ; Get print string function
  497.     mov dx,offset scrfln    ; and string to move cursor
  498.     int dos            ; Print the string
  499. ENDIF
  500. -1744
  501. IF IBMPC
  502. -1748
  503. ENDIF
  504. IF Z100
  505.     mov ah,prstr        ; Get print string function
  506.     mov dx,offset scrfln    ; and string to move cursor
  507.     int dos            ; Print the string
  508. ENDIF
  509. -1749:        mov ah,prstr            ; Print the file name.
  510. -1762,1762
  511. gf8x:
  512. IF IBMPC
  513.     mov ah,2        ; Position cursor.
  514. -1765
  515. ENDIF
  516. IF Z100
  517.     mov ah,prstr        ; Get print string function
  518.     mov dx,offset scrfr    ; and string to move cursor
  519.     int dos            ; Print the string
  520. ENDIF
  521. -1921
  522. IF IBMPC
  523. -1925
  524. ENDIF
  525. IF Z100
  526.     mov ah,prstr        ; Get print string function
  527.     mov dx,offset scrsp    ; and string to move cursor
  528.     int dos            ; Print the string
  529. ENDIF
  530. -1959
  531. IF IBMPC
  532. -1960:outchr: mov al,ah               ; Char must be in al.
  533. -1971
  534. ENDIF
  535.  
  536. IF Z100
  537. outchr:    mov al,ah        ; Yes, get the character into al
  538.     mov cx,0
  539.     cmp ibmflg,0        ; IBM mode?
  540.     je outch1        ; No, skip this
  541.     or al,080H        ; Yes, turn on parity bit
  542. outch1:    call bios_auxout    ; Send the character
  543. ENDIF
  544.  
  545. -1986,1989
  546. inchr:
  547. IF IBMPC
  548.     mov dx,mdmsts        ; Get port status.
  549.     in al,dx
  550.     test al,mdminp        ; Data available?
  551.     jnz inchr3        ; Read char ok.
  552. ENDIF
  553. IF Z100
  554.     push    bx        ; Save BX
  555.     mov ah,chr_status    ; Get the function
  556.     mov al,chr_sfgs        ; And the subfunction
  557.     call bios_auxfunc    ; Determine if anything to input
  558.     cmp bl,0        ; Is there?
  559.     jnz inchr3        ; Yes, go get it
  560.     pop bx            ; And restore BX
  561. ENDIF
  562. -2001,2002
  563.  
  564. inchr3:
  565. IF IBMPC
  566.     mov dx,mdmdat        ; Read in the char.
  567.     in al,dx
  568. ENDIF
  569. IF Z100
  570.     mov ah,chr_read        ; Get the function to read
  571.     call bios_auxfunc    ; Get a character
  572.     pop bx            ; Restore BX
  573. ENDIF
  574. -2016
  575. IF IBMPC
  576. -2020
  577. ENDIF
  578.  
  579. IF Z100
  580.     mov ah,prstr        ; Get the function to print string
  581.     mov dx,offset scrst    ; Get the string address
  582.     int dos            ; Position the cursor
  583. ENDIF
  584. -2021:    mov ah,prstr
  585. -2174,2174
  586. IF IBMPC
  587. -2178
  588. ENDIF
  589. -2192
  590. IF IBMPC
  591. -2197,2199
  592.     mov bx,mdmintv
  593.     push [bx]        ; Serial Card Interrupt vector.
  594.     mov bx,mdmintv+2
  595. -2205,2205
  596.     mov bx,mdmintv
  597. -2206:    mov ax,offset serint
  598. -2209,2209
  599.     mov bx,mdmintv+2
  600. -2227,2230
  601.     in al,intcont        ; Set up 8259 interrupt controller.
  602.     and al,MDMINTO        ; Enable INT4.
  603.     out intcont,al
  604.     mov dx,mdmcom        ; Set up baud, parity, etc.
  605. -2242,2242
  606. ENDIF
  607. IF Z100
  608.     mov ssp,sp        ; Save current stack pointer
  609. ENDIF
  610. telnoe: call plup        ; Char at port (type to console) ?
  611. IF IBMPC
  612. -2245
  613. ENDIF
  614. -2253
  615. IF IBMPC
  616. -2254:    cmp al,BELL
  617. -2261
  618. ENDIF
  619. IF Z100
  620.     mov dl,al        ; Get the character
  621.     mov ah,dconio        ; and the function
  622.     int dos            ; type the character
  623.     jmp telnoe        ; Get next character
  624. ENDIF
  625. -2265
  626. IF IBMPC
  627. -2271,2273
  628.     in al,intcont        ; Interrupt control.
  629.     or al,mdmintc        ; Inhibit IRQ4.
  630.     out intcont,al
  631. -2283,2285
  632.     mov bx,mdmintv+2    ; Restore old interrupt vectors.
  633.     pop [bx]
  634.     mov bx,mdmintv
  635. -2289
  636. ENDIF
  637. IF Z100
  638.     mov sp,ssp
  639. ENDIF
  640. -2290:    mov ah,prstr
  641. -2296
  642. IF IBMPC
  643. -2307,2311
  644.     mov dx,mdmsts        ; Asynch status port.
  645.     in al,dx
  646.     test al,mdminp        ; Data available?
  647.     jz retint        ; Nope.
  648.     mov dx,mdmdat
  649. -2325,2326
  650.     mov al,eoicom
  651.     out intcon1,al        ;Send End-of-Interrupt to 8259.
  652. -2332
  653. ENDIF
  654. -2340
  655.     nop            ; Make sure we have 3 bytes
  656. -2341:    jmp plup 
  657. -2348
  658. IF IBMPC
  659. -2365
  660. ENDIF
  661. IF Z100
  662.     push bx            ; Save BX
  663.     mov ah,chr_status    ; Get the function we want
  664.     mov al,chr_sfgs        ; Get the subfunction to get status
  665.     call bios_auxfunc    ; Perform the function
  666.     cmp bl,0        ; Anything in queue?
  667.     jne prtch1        ; Yes, go get it
  668.     pop bx            ; Restore BX
  669.     jmp rskp        ; No, give skip return
  670.  
  671. prtch1:    mov ah,chr_read        ; Want to read character
  672.     call bios_auxfunc    ; Do it
  673.     and al,07FH        ; Strip off parity bit
  674.     pop bx            ; And restore BX
  675. ENDIF
  676. -2369
  677. IF IBMPC
  678. -2392,2393
  679. ENDIF
  680.  
  681. CONCHR  PROC    NEAR
  682. IF IBMPC
  683. -2414
  684. ENDIF
  685. IF Z100
  686.     mov ah,dconio        ; Determine if character present
  687.     mov dl,0ffH        ; Want input
  688.     int dos            ; Get status
  689.     cmp al,00H        ; Any characters there?
  690.     jne nobrk        ; if not, forget it
  691.     jmp rskp        ; Give skip return
  692. ENDIF
  693. -2415:
  694. -2434
  695. IF IBMPC
  696. -2438
  697. ENDIF
  698. -2489,2490
  699. IF IBMPC
  700.     mov dx,mdmdat
  701.     out dx,al
  702. ENDIF
  703. IF Z100
  704.     call bios_auxout    ; Send the character
  705. ENDIF
  706. -2495
  707. IF IBMPC
  708. -2525
  709. ENDIF
  710. -2526:        jmp telnoe              ; Return home.
  711. -2528
  712. IF IBMPC
  713. -2657
  714. ENDIF
  715. -2733
  716. IF IBMPC
  717. -2747
  718. ENDIF
  719. -2813
  720. IF IBMPC
  721. -2814:    mov dx,03FBH        ; LCR
  722. -2827
  723. ENDIF
  724. IF Z100
  725.     mov bx,ds        ; Set up pointer to config info
  726.     mov es,bx        ;  .  .  .
  727.     mov bx,offset auxcnf    ;  .  .  .
  728.     mov ah,chr_control    ; Function is control
  729.     mov al,chr_cfsu        ; Subfunction is set new config
  730.     call bios_auxfunc    ; Set the configuration
  731. ENDIF
  732. -2848
  733. IF IBMPC
  734. -2854
  735. ENDIF
  736. -2872
  737. IF Z100
  738.     mov dx,offset b04st
  739.     cmp baud,B00455
  740.     jz stat9a
  741.     mov dx,offset b05st
  742.     cmp baud,B0050
  743.     jz stat9a
  744.     mov dx,offset b07st
  745.     cmp baud,b0075
  746.     jz stat9a
  747.     mov dx,offset b11st
  748.     cmp baud,B0110
  749.     jz stat9a
  750.     mov dx,offset b13st
  751.     cmp baud,B01345
  752.     jz stat9a
  753.     mov dx,offset b15st
  754.     cmp baud,B0150
  755.     jz stat9a
  756.     mov dx,offset b06st
  757.     cmp baud,B0600
  758.     jne stat9b
  759. stat9a:    jmp stat9
  760. stat9b:    mov dx,offset b20st
  761.     cmp baud,B2000
  762.     jz stat9
  763.     mov dx,offset b24st
  764.     cmp baud,B2400
  765.     jz stat9
  766.     mov dx,offset b96st
  767.     cmp baud,B9600
  768.     jz stat9
  769.     mov dx,offset b19st
  770.     cmp baud,B19200
  771.     jz stat9
  772.     mov dx,offset b38st
  773.     cmp baud,B38400
  774.     jz stat9
  775. ENDIF
  776. -3501
  777. IF IBMPC
  778. -3502:    mov ax,0920H               ; Write spaces.
  779. -3505
  780. ENDIF
  781. -3617
  782. IF IBMPC
  783. -3622
  784. ENDIF
  785. IF Z100
  786.     mov ah,prstr        ; Get the function code
  787.     mov dx,offset clrscr    ; Want to clear the screen
  788.     int dos            ; Do it
  789. ENDIF
  790. -3628
  791. IF IBMPC
  792. -3632
  793. ENDIF
  794. IF Z100
  795.     mov ah,prstr        ; Function is print string
  796.     mov dx,offset homcur    ; Home cursor
  797.     int dos            ; do it
  798. ENDIF
  799. -3633:    ret
  800.